[RFC] New module: Graphics::ColorUtils

I am looking for comments on a new module I propose
for inclusion in CPAN:
Graphics::ColorUtils

This module will provide helper functions to manage
color. It will be useful when generating graphics using
modules such as GD, Tk, or when generating HTML/CSS.

The module provides three sets of features:
- Color space conversion (RGB to HSV, etc)
- Color gradients (useful for data visualization)
- Color lookup by name

The main rationale for creating a new module was
the need for a module with easy-to-use color conversions
(easier than Graphics::ColorObject). Also, color gradients
are often useful for data visualization, but are currently not
offered by any Perl module (that I am aware of). Name
lookup has been thrown in for good measure, but I do not
consider it essential (Graphics::ColorNames does something
very similar).

The design objectives were:
- A simple and intuitive API, which has a small enough
footprint that it can be used inline in calls to other
functions.
- Platform independence (do not assume X11)
- Minimal dependencies

The current version of the code and documentation are
available here:
http://www.beyondcode.org/projects/index.html


Related modules and existing work:
- Graphics::ColorObject (and Color::Object) do color space
conversions, but using a very different API, much less
suitable for the intended usage of the proposed module.
- Graphics::ColorNames and Color::Rgb do color-for-name
lookup. (There is real redundancy with ColorNames
and the current module - should it be dropped? However,
there is real benefit in keeping all functionality together.)
- No module offers color gradients (to my knowledge).


Any thoughts/suggestions?
PKJ [ Mo, 13 November 2006 20:23 ] [ ID #1534266 ]

Re: [RFC] New module: Graphics::ColorUtils

"pkj" <janert [at] mailaps.org> wrote:

> - Graphics::ColorNames and Color::Rgb do color-for-name

I suggest to call the latter Color::RGB, the Rgb is going to confuse me at
least, and might confuse more people.

> - No module offers color gradients (to my knowledge).

I am very interested in this one :-D.

--
John Experienced Perl programmer: http://castleamber.com/

Perl help, tutorials, and examples: http://johnbokma.com/perl/
John Bokma [ Mo, 13 November 2006 21:55 ] [ ID #1534267 ]

Re: [RFC] New module: Graphics::ColorUtils

On Tue, 14 Nov 2006 06:23:39 +1100, pkj wrote:

Hi

> The module provides three sets of features:
> - Color space conversion (RGB to HSV, etc)
> - Color gradients (useful for data visualization)
> - Color lookup by name

How about putting these 3 features in 3 modules, all under your chosen
namespace?
Ron Savage [ Mo, 13 November 2006 21:53 ] [ ID #1534268 ]

Re: New module: Graphics::ColorUtils

Just to clarify - I did NOT write Color::Rgb. That is a pre-existing
module,
which I am just mentioning here for comparison purposes.

John Bokma wrote:
> "pkj" <janert [at] mailaps.org> wrote:
>
> > - Graphics::ColorNames and Color::Rgb do color-for-name
>
> I suggest to call the latter Color::RGB, the Rgb is going to confuse me at
> least, and might confuse more people.
>
> > - No module offers color gradients (to my knowledge).
>
> I am very interested in this one :-D.
>
> --
> John Experienced Perl programmer: http://castleamber.com/
>
> Perl help, tutorials, and examples: http://johnbokma.com/perl/
PKJ [ Mo, 13 November 2006 22:40 ] [ ID #1534269 ]

Re: [RFC] New module: Graphics::ColorUtils

pkj wrote:
> I am looking for comments on a new module I propose
> for inclusion in CPAN:
> Graphics::ColorUtils
>
> This module will provide helper functions to manage
> color. It will be useful when generating graphics using
> modules such as GD, Tk, or when generating HTML/CSS.
>
> The module provides three sets of features:
> - Color space conversion (RGB to HSV, etc)
> - Color gradients (useful for data visualization)
> - Color lookup by name
>

Out of curiousity, which gradient functions are you
implementing ? FWIW: I've implemented some primitive
gradient support in Tk::StyledButton, but would certainly appreciate
a more robust, and separately packaged, solution.

Dean Arnold
Presicient Corp.
Dean Arnold [ Mo, 13 November 2006 22:51 ] [ ID #1534270 ]

Re: New module: Graphics::ColorUtils

Actually - none. The module comes with some pre-packaged
gradients (as data), which are chosen to provide a visually
uniform impression.

Thanks for the hint, though - I will take a look.

Dean Arnold wrote:
(snip)
>
> Out of curiousity, which gradient functions are you
> implementing ? FWIW: I've implemented some primitive
> gradient support in Tk::StyledButton, but would certainly appreciate
> a more robust, and separately packaged, solution.
>
> Dean Arnold
> Presicient Corp.
PKJ [ Mo, 13 November 2006 23:01 ] [ ID #1534271 ]

Re: New module: Graphics::ColorUtils

"pkj" <janert [at] mailaps.org> wrote:

>
> Just to clarify - I did NOT write Color::Rgb. That is a pre-existing
> module,
> which I am just mentioning here for comparison purposes.

Ah, my bad, apologies.

--
John Experienced Perl programmer: http://castleamber.com/

Perl help, tutorials, and examples: http://johnbokma.com/perl/
John Bokma [ Di, 14 November 2006 00:30 ] [ ID #1534272 ]
Perl » comp.lang.perl.modules » [RFC] New module: Graphics::ColorUtils

Vorheriges Thema: Appropriate Namespace for a PBKDF1 implementation?
Nächstes Thema: SSH Modules: Accessing CLI box using SSH and not getting the return output??